<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>v-model结合checkbox类型</title>
    <script src="js/vue.min.js"></script>
</head>
<body>
<div id="app">
    <!--checkbox单选框-->
    <h2>单选框</h2>
    <label for="agree">
        <input id="agree" type="checkbox" v-model="isAgree">同意协议
    </label>

    <div>你选择的结果是：{{isAgree}}</div>
    <button :disabled="!isAgree">下一步</button>

    <!--checkbox多选框-->
    <h2>多选框</h2>
    <label v-for="(item,index) in oriHobbies" :key="index" >
        <input type="checkbox" name="hobby" :value="item" :id="item" v-model="hobbies">{{item}}
    </label>
    <div>你的爱好是： {{hobbies}}</div>
</div>
</body>
<script>
    const app = new Vue({
        el:"#app",
        data:{
            message:'zzz',
            isAgree:false,
            hobbies:[],
            oriHobbies:['篮球','足球','羽毛球','兵乓球']
        }
    })
</script>
</html>